package com.woniuxy.third.service.impl;

import com.woniuxy.third.entity.Teacher;
import com.woniuxy.third.entity.TeacherInfo;
import com.woniuxy.third.entity.Teacherauth;
import com.woniuxy.third.mapper.TeacherMapper;
import com.woniuxy.third.service.TeacherService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Author: yangtao
 * @date 2021/7/19 10:55
 * @Version 1.0
 */
@Service
public class TeacherServiceImpl implements TeacherService {
    @Resource
    private TeacherMapper teacherMapper;
    @Override
    public Teacher findById(int id) {
        Teacher teacher = teacherMapper.findById(id);
        return teacher;
    }

    @Override
    @Transactional
    public boolean addInfo(Teacher teacher) {

        return teacherMapper.addInfo(teacher);
    }

    @Override
    public void imageUpload(String path,int id) {
        teacherMapper.imageUpload(path,id);
    }

    @Override
    public void updateQualification(String path, int tid) {
        System.out.println("1111111111111111111111111111111111111");
        teacherMapper.updateQualification(path, tid);
    }

    @Override
    public int updatePhone(String phone,int id) {
        int i=teacherMapper.updatePhone(phone,id);
        return i;
    }

    @Override
    public int updateIntro(String intro, int id) {
        int i=teacherMapper.updateIntro(intro,id);
        return i;
    }

    @Override
    public int delinfo(int id) {
        int i=teacherMapper.delinfo(id);
        return 0;
    }

    @Override
    public void updateinfo(Teacher teacher) {
        teacherMapper.updateinfo(teacher);
    }

    @Override
    public void updateauth(Teacherauth teacher) {
        teacherMapper.updateauth(teacher);
    }
}
